package com.apes.project.jekunAuto.timeTask.scm;


import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.apes.framework.plugin.esb.api.SimpleRequest;
import com.apes.pi.service.PiManager;
import com.apes.scm.masterdata.area.service.AreaService;
import com.apes.scm.masterdata.area.service.CountryService;
import com.apes.scm.masterdata.contrast.repository.ContrastPartyCodeRepository;
import com.apes.scm.masterdata.enumeration.repository.EnumerationRepository;
import com.apes.scm.masterdata.enumeration.service.EnumerationService;
import com.apes.scm.masterdata.party.repository.PartyIdentificationRepository;
import com.apes.scm.masterdata.party.repository.PartyRoleRepository;
import com.apes.scm.masterdata.party.repository.RoleTypeRepository;
import com.apes.scm.masterdata.party.service.PartyService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service("khxxSynService")
public class KhxxSynService extends BaseInfoSynService {
    @Autowired
    ContrastPartyCodeRepository contrastPartyCodeRepository;
    @Autowired
    EnumerationRepository enumerationRepository;
    @Autowired
    RoleTypeRepository roleTypeRepository;
    @Autowired
    PartyRoleRepository partyRoleRepository;
    @Autowired
    PartyService partyService;
    @Autowired
    PartyIdentificationRepository partyIdentificationRepository;
    @Autowired
    CountryService countryService;
    @Autowired
    AreaService areaService;
    @Autowired
    EnumerationService enumerationService;
    @Autowired
    PiManager piManager;

    /**
     * 获取老系统客户信息
     * @param simpleRequest
     * @return
     */
    public JSONArray synKhxxInfos(SimpleRequest simpleRequest) {
        return piManager.timedTaskSynErp("ipmUpateKHXXService.qryKHXX");
    }

    public void saveKhxxInfo(SimpleRequest simpleRequest){
        JSONObject simpleObj = simpleRequest.getJO();
        simpleObj.put("thisType","Customer");
        synPartyBase(simpleObj);
    }
}
